/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package api.gest;

import api.dom.Pago;
import java.util.ArrayList;

/**
 *
 * @author Enrico
 */
public class GestPago {
    private ArrayList<Pago> mColPago = new ArrayList<Pago>();
    private static GestPago objGestP = null;
    
      public static GestPago getInstance()
  {
        if (objGestP == null){
            objGestP = new GestPago();
            }
        return objGestP;
  }
      
      public boolean verificarPago(Pago xObjP){
          for(Pago p:mColPago){
              if(p.getpNumeroPago()==xObjP.getpNumeroPago()){
                  return true;
              }
          }
          return false;
      }
      
      public boolean altaPago(Pago xObjP){
          if(!verificarPago(xObjP)){
              mColPago.add(xObjP);
              return true;
          }
          return false;
      }
      
      public ArrayList<Pago> devolverPagos(){
          return mColPago;
      }
    
}
